
{***********************************************************}
{                                                           }
{      Informix esql "sqlproto.h"                           }
{                                                           }
{      Translated to Object Pascal by                       }
{      Copyright (c) 2001-2008 Luxena Software Company      }
{      http://www.luxena.com                                }
{      e-mail: support@luxena.com                           }
{                                                           }
{***********************************************************}

unit IfxSqlProto;

{$I lx.inc}

interface

uses
  LXTypes, IfxTypes, IfxDecimal, IfxDateTime, IfxCollect, IfxLocator,
  IfxSqlHdr, IfxInt8;

type

  TCallBackProc = procedure(Param: Integer); cdecl;
  Tbycmpr = function(s1: PChar; s2: PChar; cnt: Integer): Integer; cdecl;
  Tbycopy = procedure(s1: PChar; s2: PChar; n: Integer); cdecl;
  Tbyfill = procedure(s: PChar; n: Integer; c: Char); cdecl;
  Tbyleng = function(beg: PChar; cnt: Integer): Integer; cdecl;
  Tdecadd = function(n1: PDecimal; n2: PDecimal; n3: PDecimal): Integer; cdecl;
  Tdeccmp = function(n1: PDecimal; n2: PDecimal): Integer; cdecl;
  Tdeccopy = procedure(n1: PDecimal; n2: PDecimal); cdecl;
  Tdeccvasc = function(cp: PChar; len: Integer; np: PDecimal): Integer; cdecl;
  Tdeccvdbl = function(dbl: Double; np: PDecimal): Integer; cdecl;
  Tdeccvint = function(in_: Integer; np: PDecimal): Integer; cdecl;
  Tdeccvlong = function(lng: LongInt; np: PDecimal): Integer; cdecl;
  Tdecdiv = function(n1: PDecimal; n2: PDecimal; n3: PDecimal): Integer; cdecl;
  Tdececvt = function(np: PDecimal; ndigit: Integer; decpt: PInteger; sign: PInteger): PChar; cdecl;
  Tdecfcvt = function(np: PDecimal; ndigit: Integer; decpt: PInteger; sign: PInteger): PChar; cdecl;
  Tdecmul = function(n1: PDecimal; n2: PDecimal; n3: PDecimal): Integer; cdecl;
  Tdecround = procedure(np: PDecimal; dec_round: Integer); cdecl;
  Tdecsub = function(n1: PDecimal; n2: PDecimal; n3: PDecimal): Integer; cdecl;
  Tdectoasc = function(np: PDecimal; cp: PChar; len: Integer; right: Integer): Integer; cdecl;
  Tdectodbl = function(np: PDecimal; dblp: PDouble): Integer; cdecl;
  Tdectoint = function(np: PDecimal; ip: PInteger): Integer; cdecl;
  Tdectolong = function(np: PDecimal; lngp: PInteger): Integer; cdecl;
  Tdectrunc = procedure(np: PDecimal; trunc: Integer); cdecl;
  Tdtcurrent = procedure(d: PDTime); cdecl;
  Tdtcvasc = function(str: PChar; d: PDTime): Integer; cdecl;
  TIfx_dtcvasc = function(str: PChar; d: PDTime; db_century: Char): Integer; cdecl;
  Tdtcvfmtasc = function(input: PChar; fmt: PChar; d: PDTime): Integer; cdecl;
  Tifx_dtcvfmtasc = function(input: PChar; fmt: PChar; d: PDTime; db_century: Char): Integer; cdecl;
  Tdtextend = function(id: PDTime; od: PDTime): Integer; cdecl;
  Tdttoasc = function(d: PDTime; str: PChar): Integer; cdecl;
  Tdttofmtasc = function(d: PDTime; output: PChar; str_len: Integer; fmtstr: PChar): Integer; cdecl;
  TIfx_dttofmtasc = function(d: PDTime; output: PChar; str_len: Integer; fmtstr: PChar; db_century: Char): Integer; cdecl;
  Tincvasc = function(str: PChar; i: PIntrvl): Integer; cdecl;
  Tincvfmtasc = function(input: PChar; fmt: PChar; intvl: PIntrvl): Integer; cdecl;
  Tintoasc = function(i: PIntrvl; str: PChar): Integer; cdecl;
  Tintofmtasc = function(i: PIntrvl; output: PChar; str_len: Integer; fmtstr: PChar): Integer; cdecl;
  Trdatestr = function(jdate: Integer; str: PChar): Integer; cdecl;
  Trdayofweek = function(date: Integer): Integer; cdecl;
  Trdefmtdate = function(pdate: PInteger; fmtstring: PChar; input: PChar): Integer; cdecl;
  TIfx_defmtdate = function(pdate: PInteger; fmtstring: PChar; input: PChar; db_century: Char): Integer; cdecl;
  Trdownshift = procedure(s: PChar); cdecl;
  Trfmtdate = function(date: Integer; fmtstring: PChar; result_: PChar): Integer; cdecl;
  Trfmtdec = function(dec: PDecimal; format: PChar; outbuf: PChar): Integer; cdecl;
  Trfmtdouble = function(dvalue: Double; format: PChar; outbuf: PChar): Integer; cdecl;
  Trfmtlong = function(lvalue: Integer; format: PChar; outbuf: PChar): Integer; cdecl;
  Trget_lmsg = function(msgnum: Integer; s: PChar; maxsize: Integer; msg_length: PInteger): Integer; cdecl;
  Trgetlmsg = function(msgnum: Integer; s: PChar; maxsize: Integer; msg_length: PInteger): Integer; cdecl;
  Trgetmsg = function(msgnum: Integer; s: PChar; maxsize: Integer): Integer; cdecl;
  Trisnull = function(vtype: Integer; pcvar: PChar): Integer; cdecl;
  Trjulmdy = function(jdate: Integer; mdy: PSmallInt): Integer; cdecl;
  Trleapyear = function(year: Integer): Integer; cdecl;
  Trmdyjul = function(mdy: PSmallInt; jdate: PInteger): Integer; cdecl;
  Trsetnull = function(vtype: Integer; pcvar: PChar): Integer; cdecl;
  Trstrdate = function(str: PChar; jdate: PInteger): Integer; cdecl;
  TIfx_strdate = function(str: PChar; jdate: PInteger; db_century: Char): Integer; cdecl;
  Trtoday = procedure(today: PInteger); cdecl;
  Trtypalign = function(offset: Integer; AType: Integer): Integer; cdecl;
  Trtypmsize = function(Type_: Integer; len: Integer): Integer; cdecl;
  Trtypname = function(Type_: Integer): PChar; cdecl;
  Trtypwidth = function(Type_: Integer; len: Integer): Integer; cdecl;
  Trupshift = procedure(s: PChar); cdecl;
  Tsqlexit = function: Integer; cdecl;
  Tldchar = procedure(from: PChar; count: Integer; to_: PChar); cdecl;
  Tstcat = procedure(src: PChar; dst: PChar); cdecl;
  Tstchar = procedure(from: PChar; to_: PChar; count: Integer); cdecl;
  Tstcmpr = function(s1: PChar; s2: PChar): Integer; cdecl;
  Tstcopy = procedure(src: PChar; dst: PChar); cdecl;
  Tstleng = function(src: PChar): Integer; cdecl;
  Trstod = function(str: PChar; val: PDouble): Integer; cdecl;
  Trstoi = function(s: PChar; val: PInteger): Integer; cdecl;
  Trstol = function(s: PChar; val: PInteger): Integer; cdecl;
  Tsqgetdbs = function(ret_fcnt: PInteger; fnames: PPChar; fnsize: Integer; farea: PChar; fasize: Integer): Integer; cdecl;
  Tsqlbreak = function: Integer; cdecl;
  Tsqlbreakcallback = function(timeout: Integer; callbackProc: TCallBackProc): Integer; cdecl;
  Tsqldetach = function: Integer; cdecl;
  Tsqldone = function: Integer; cdecl;
  Tsqlstart = function: Integer; cdecl;
  Tdtaddinv = function(d: PDTime; i: PIntrvl; r: PDTime): Integer; cdecl;
  Tdtsub = function(d1: PDTime; d2: PDTime; i: PIntrvl): Integer; cdecl;
  Tdtsubinv = function(d: PDTime; i: PIntrvl; r: PDTime): Integer; cdecl;
  Tinvdivdbl = function(iv: PIntrvl; dbl: Double; ov: PIntrvl): Integer; cdecl;
  Tinvdivinv = function(i1: PIntrvl; i2: PIntrvl; res: PDouble): Integer; cdecl;
  Tinvextend = function(i: PIntrvl; o: PIntrvl): Integer; cdecl;
  Tinvmuldbl = function(iv: PIntrvl; dbl: Double; ov: PIntrvl): Integer; cdecl;
  TIfx_to_gl_datetime = function(source_str: PChar; target_str: PChar; maxlen: Integer): Integer; cdecl;
  TGetConnect = function: Pointer; cdecl;
  TSetConnect = function(NewConInfo: Pointer): Pointer; cdecl;
  TReleaseConnect = function(NewConInfo: Pointer): Pointer; cdecl;
  Tdeccvflt = function(source: Double; destination: PDecimal): Integer; cdecl;
  Tdectoflt = function(source: PDecimal; destination: PSingle): Integer; cdecl;
  TIfx_getenv = function(const env_name: PChar): PChar; cdecl;
  TIfx_putenv = function(const env_name: PChar): Integer; cdecl;
  T_infxcexp = function(RtnNum: Integer; RtnAddr: Pointer; OptParm: Integer): Integer; cdecl;
  TSqlFreeMem = procedure(MemAddr: Pointer; FreeType: Integer); cdecl;
  TIfx_getcur_conn_name = function: PChar; cdecl;

  TIfx_int8cmp = function(op1: PIfx_int8; op2: PIfx_int8): Integer; cdecl;
  TIfx_int8cvlong = function(lng: Integer; int8p: PIfx_int8): Integer; cdecl;
  TIfx_int8tolong = function(int8p: PIfx_int8; lngp: PInteger): Integer; cdecl;
  TIfx_int8cvint = function(in_: Integer; int8p: PIfx_int8): Integer; cdecl;
  TIfx_int8toint = function(int8p: PIfx_int8; intp: PInteger): Integer; cdecl;
  TIfx_int8toint2 = function(int8p: PIfx_int8; int2p: PSmallInt): Integer; cdecl;
  TIfx_int8toint4 = function(int8p: PIfx_int8; int4p: PInteger): Integer; cdecl;
  TIfx_int8cvasc = function(cp: PChar; len: Integer; int8p: PIfx_int8): Integer; cdecl;
  TIfx_int8toasc = function(int8p: PIfx_int8; cp: PChar; len: Integer): Integer; cdecl;
  TIfx_int8cvdec = function(decp: PDecimal; int8p: PIfx_int8): Integer; cdecl;
  TIfx_int8todec = function(int8p: PIfx_int8; desp: PDecimal): Integer; cdecl;
  TIfx_int8cvdbl = function(dbl: Double; int8p: PIfx_int8): Integer; cdecl;
  TIfx_int8todbl = function(int8p: PIfx_int8; dbl: PDouble): Integer; cdecl;
  TIfx_int8cvflt = function(flt: Double; int8p: PIfx_int8): Integer; cdecl;
  TIfx_int8toflt = function(int8p: PIfx_int8; fltp: PSingle): Integer; cdecl;
  Tdeccvint8 = function(int8p: PIfx_int8; decp: PDecimal): Integer; cdecl;
  TIfx_int8sub = function(int8op1: PIfx_int8; int8op2: PIfx_int8; int8result: PIfx_int8): Integer; cdecl;
  TIfx_int8add = function(int8op1: PIfx_int8; int8op2: PIfx_int8; int8result: PIfx_int8): Integer; cdecl;
  TIfx_int8mul = function(int8op1: PIfx_int8; int8op2: PIfx_int8; int8result: PIfx_int8): Integer; cdecl;
  TIfx_int8div = function(int8op1: PIfx_int8; int8op2: PIfx_int8; int8result: PIfx_int8): Integer; cdecl;
  TIfx_int8copy = procedure(sint8p: PIfx_int8; dint8p: PIfx_int8); cdecl;
  TIfx_getserial8 = procedure(int8p: PIfx_int8); cdecl;

  TIfx_cl_dealloc = function(collection: PPIfx_collection): Integer; cdecl;
  TIfx_get_row_xid = function(collp: PIfx_collection; colnum: PInteger): Integer; cdecl;
  TIfx_get_row_extended_name = function(collp: PIfx_collection): PChar; cdecl;
  TIfx_get_msg_param = function: PChar; cdecl;

  TIfx_var_flag = function(variable: PPointer; alloc_flag: SmallInt): Integer; cdecl;
  TIfx_var_alloc = function(variable: PPointer; size: Integer): Integer; cdecl;
  TIfx_var_dealloc = function(variable: PPointer): Integer; cdecl;
  TIfx_var_freevar = function(variable: PPointer): Integer; cdecl;
  TIfx_var_setdata = function(variable: PPointer; data: PChar; size: Integer): Integer; cdecl;
  TIfx_var_isnull = function(variable: PPointer): Integer; cdecl;
  TIfx_var_setnull = function(variable: PPointer; Flag: Integer): Integer; cdecl;
  TIfx_var_setlen = function(variable: PPointer; size: Integer): Integer; cdecl;
  TIfx_var_getdata = function(variable: PPointer): Pointer; cdecl;
  TIfx_var_init = function(variable: PPointer): Integer; cdecl;
  TIfx_var_getlen = function(variable: PPointer): Integer; cdecl;
  TIfx_lvar_alloc = function(alloc: Integer): Integer; cdecl;

// Set of ifx_lo_* accessors for opaque data types:
//	- ifx_lo_create_spec_t
//	- ifx_lo_stat_t
//
// See also: locator.h for description of possible values for arguments

// smartblob create spec SET accessors:
  TIfx_lo_specset_flags = function(cspec: PIfx_lo_create_spec; flags: Integer): Integer; cdecl;
  TIfx_lo_specset_def_open_flags = function(cspec: PIfx_lo_create_spec; def_open_flags: Integer): Integer; cdecl;
  TIfx_lo_specset_estbytes = function(cspec: PIfx_lo_create_spec; size: PIfx_Int8): Integer; cdecl;
  TIfx_lo_specset_maxbytes = function(cspec: PIfx_lo_create_spec; size: PIfx_Int8): Integer; cdecl;
  TIfx_lo_specset_extsz = function(cspec: PIfx_lo_create_spec; n: Integer): Integer; cdecl;
  TIfx_lo_specset_sbspace = function(cspec: PIfx_lo_create_spec; const str: PChar): Integer; cdecl;

// smartblob create spec GET accessors:
  TIfx_lo_specget_flags = function(cspec: PIfx_lo_create_spec): Integer; cdecl;
  TIfx_lo_specget_def_open_flags = function(cspec: PIfx_lo_create_spec): Integer; cdecl;
  TIfx_lo_specget_estbytes = function(cspec: PIfx_lo_create_spec; size: PIfx_int8): Integer; cdecl;
  TIfx_lo_specget_maxbytes = function(cspec: PIfx_lo_create_spec; size: PIfx_int8): Integer; cdecl;
  TIfx_lo_specget_extsz = function(cspec: PIfx_lo_create_spec): Integer; cdecl;
  TIfx_lo_specget_sbspace = function(cspec: PIfx_lo_create_spec; str: PChar; len: Integer): Integer; cdecl;

// smartblob stat GET accessors:
  TIfx_lo_stat_size = function(lostat: PIfx_lo_stat; size: PIfx_Int8): Integer; cdecl;
  TIfx_lo_stat_uid = function(lostat: PIfx_lo_stat): Integer; cdecl;
  TIfx_lo_stat_atime = function(lostat: PIfx_lo_stat): Integer; cdecl;
  TIfx_lo_stat_mtime_sec = function(lostat: PIfx_lo_stat): Integer; cdecl;
  TIfx_lo_stat_mtime_usec = function(lostat: PIfx_lo_stat): Integer; cdecl;
  TIfx_lo_stat_ctime = function(lostat: PIfx_lo_stat): Integer; cdecl;
  TIfx_lo_stat_refcnt = function(lostat: PIfx_lo_stat): Integer; cdecl;
  TIfx_lo_stat_cspec = function(lostat: PIfx_lo_stat): PIfx_lo_create_spec; cdecl;

// smartblob spec and stat destructors:
  TIfx_lo_spec_free = function(cspec: PIfx_lo_create_spec): Integer; cdecl;
  TIfx_lo_stat_free = function(lostat: PIfx_lo_stat): Integer; cdecl;

// Set of ifx_lo_ functions for support of Large Objects
  TIfx_lo_col_info = function(column_name: PChar; create_spec: PIfx_lo_create_spec): Integer; cdecl;
  TIfx_lo_def_create_spec = function(cspec: PPIfx_lo_create_spec): Integer; cdecl;
  TIfx_lo_create = function(create_spec: PIfx_lo_create_spec; flags: Integer; loptr: PIfx_lo; error: PInteger): Integer; cdecl;
  TIfx_lo_open = function(loptr: PIfx_lo; flags: Integer; error: PInteger): Integer; cdecl;
  TIfx_lo_close = function(lofd: Integer): Integer; cdecl;
  TIfx_lo_seek = function(lofd: Integer; off: PIfx_Int8; whence: Integer; seek_pos: PIfx_Int8): Integer; cdecl;
  TIfx_lo_tell = function(lofd: Integer; seek_pos: PIfx_Int8): Integer; cdecl;
  TIfx_lo_truncate = function(lofd: Integer; off: PIfx_Int8): Integer; cdecl;
  TIfx_lo_filename = function(loptr: PIfx_lo; fname: PChar; result_: PChar; result_buffer_nbytes: Integer): Integer; cdecl;
  TIfx_lo_alter = function(loptr: PIfx_lo; create_spec: PIfx_lo_create_spec): Integer; cdecl;
  TIfx_lo_stat = function(lofd: Integer; lostat: PPIfx_lo_stat): Integer; cdecl;
  TIfx_lo_read = function(lofd: Integer; buf: PChar; nbytes: Integer; error: PInteger): Integer; cdecl;
  TIfx_lo_readwithseek = function(lofd: Integer; buf: PChar; nbytes: Integer; off: PIfx_Int8; whence: Integer; error: PInteger): Integer; cdecl;
  TIfx_lo_write = function(lofd: Integer; buf: PChar; nbytes: Integer; error: PInteger): Integer; cdecl;
  TIfx_lo_writewithseek = function(lofd: Integer; buf: PChar; nbytes: Integer; off: PIfx_Int8; whence: Integer; error: PInteger): Integer; cdecl;
  TIfx_lo_copy_to_lo = function(lofd: Integer; fname: PChar; flags: Integer): Integer; cdecl;
  TIfx_lo_copy_to_file = function(loptr: PIfx_lo; fname: PChar; flags: Integer; result_: PChar): Integer; cdecl;
  TIfx_lo_release = function(loptr: PIfx_lo): Integer; cdecl;
  TIfx_lo_to_buffer = function(lo_handle: PIfx_lo; size_limit: Integer; buffer: PPChar; error: PInteger): Integer; cdecl;
  TIfx_lo_from_buffer = function(lo_handle: PIfx_lo; size: Integer; buffer: PChar; error: PInteger): Integer; cdecl;
  TIfx_lo_lock = function(lofd: Integer; off: PIfx_int8; whence: Integer; range: PIfx_int8; lockmode: Integer): Integer; cdecl;
  TIfx_lo_unlock = function(lofd: Integer; off: PIfx_int8; whence: Integer; range: PIfx_int8): Integer; cdecl;

  TIfx_xactevent = function(p: Pointer): Integer; cdecl;
  TIfx_getserowner = function(serowner: PChar): Integer; cdecl;

  TIfx_alloc_conn_user = function(username: PChar; passwd: PChar): Pointer; cdecl;
  TIfx_free_conn_user = procedure(conn: PPIfx_conn); cdecl;
  TIfx_alloc_conn_cred = function(cred: Pointer): Pointer; cdecl;
  TIfx_free_conn_cred = procedure(conn: PPIfx_conn); cdecl;
  TIfx_isius = function: Integer; cdecl;
  TIfx_cl_card = function(colt: PIfx_Collection; isnull: PInteger): Integer; cdecl;
  Tsqli_server_version = function: PChar; cdecl;
  Tldcollection = function(cp: PChar; collp: PIfx_Collection; readsize: mint; longidver: mint): Integer; cdecl;
  Tstcollection = procedure(collp: PIfx_collection; start: PChar; longidver: mint); cdecl;


implementation

end.